﻿using Dapper;
using System;
using BCEntity.Sim.Company.Position;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Sim.Company.Position
{
	/// <summary>
	/// 岗位
	/// </summary>
	public interface IPositionData
	{
		#region  成员方法
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		/// <param name="positionId">岗位Id</param>
		Task<bool> Exists(int positionId);
		/// <summary>
		/// 增加岗位
		/// </summary>
		/// <param name="entity">岗位信息</param>
		Task<PositionEntity> Add(PositionEntity entity);
		/// <summary>
		/// 更新岗位
		/// </summary>
		/// <param name="entity">岗位信息</param>
		Task<PositionEntity> Update(PositionEntity entity);
		/// <summary>
		/// 删除岗位
		/// </summary>
		/// <param name="positionId">岗位Id</param>
		Task<bool> Delete(int positionId);
		/// <summary>
		/// 获取岗位
		/// </summary>
		/// <param name="positionId">岗位Id</param>
		Task<PositionEntity> GetEntity(int positionId);
		/// <summary>
		/// 获取岗位
		/// </summary>
		/// <param name="companyId">公司Id</param>
		/// <param name="departmentId">部门Id</param>
		/// <param name="positionNo">岗位编号</param>
		Task<PositionEntity> GetEntity(int companyId, int departmentId, string positionNo);
		/// <summary>
		/// 获取岗位列表
		/// </summary>
		/// <param name="companyId">公司Id</param>
		/// <param name="departmentId">部门Id</param>
		/// <param name="enabled">启用</param>
		Task<IEnumerable<PositionEntity>> GetList(int companyId, int? departmentId, bool? enabled);
		/// <summary>
		/// 获取岗位分页列表
		/// </summary>
		/// <param name="companyId">公司Id</param>
		/// <param name="departmentId">部门Id</param>
		/// <param name="enabled">启用</param>
		/// <param name="start">开始时间</param>
		/// <param name="end">结束时间</param>
		/// <param name="sortName">排序字段</param>
		/// <param name="ascending">升序</param>
		/// <param name="pageIndex">当前页码</param>
		/// <param name="pageSize">每页数据条数</param>
		Task<(IEnumerable<PositionEntity>, int)> Query(int? companyId, int? departmentId, bool? enabled, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
		/// <summary>
		/// 启用岗位
		/// </summary>
		/// <param name="positionId">岗位Id</param>
		Task<bool> Enabled(int positionId);
		/// <summary>
		/// 禁用岗位
		/// </summary>
		/// <param name="positionId">岗位Id</param>
		Task<bool> Disabled(int positionId);
		#endregion  成员方法
	}


}